home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.1 (Developer) [x86] / NeXT Step 3.1 Intel dev.cdr.dmg / NextDeveloper / Headers / kernserv / prototypes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-30  |  3.0 KB  |  101 lines

  1. /*    @(#)ldd.h    2.0    03/20/90    (c) 1990 NeXT    
  2.  *
  3.  * kernserv/prototypes.h - kernel prototypes used by loadable device drivers
  4.  *
  5.  * HISTORY
  6.  * 22-May-91    Gregg Kellogg (gk) at NeXT
  7.  *    Split out public interface.  KERNEL_FEATURES is used to not conflict
  8.  *    with within-KERNEL definitions.
  9.  *
  10.  * 16-Aug-90  Gregg Kellogg (gk) at NeXT
  11.  *    Removed a lot of stuff that's defined in other header files. 
  12.  *    Eventually this file should either go away or contain only imports of
  13.  *    other files.
  14.  *
  15.  * 20-Mar-90    Doug Mitchell at NeXT
  16.  *    Created.
  17.  *
  18.  */
  19.  
  20. #ifndef    _KERN_INTERNAL_PROTOTYPES_
  21. #define _KERN_INTERNAL_PROTOTYPES_
  22.  
  23. #import <sys/types.h>
  24. #import <kernserv/printf.h>
  25. #import <sys/kernel.h>
  26. #import <sys/buf.h>
  27. #import <sys/uio.h>
  28. #ifdef    m68k
  29. #import <bsd/dev/m68k/autoconf.h>
  30. #endif    m68k
  31. #import <kernserv/machine/us_timer.h>
  32. #import <kernserv/lock.h>
  33.  
  34. /* Copy or initialize data: */
  35. int copyin(const void *p1, void *p2, unsigned int size);
  36. int copyout(const void *p1, void *p2, unsigned int size);
  37. void bcopy(const void *src, void *dest, int length);
  38. void bzero(void *bp, int size);
  39.  
  40. #ifdef    KERNEL
  41. #import <kernserv/kalloc.h>
  42.  
  43. /* Cause a thread to sleep or wakeup: */
  44. void    assert_wait(int event, boolean_t interruptible);
  45. void    biodone(struct buf *bp);
  46. void    biowait(struct buf *bp);
  47. void    clear_wait(thread_t thread, int result, boolean_t interrupt_only);
  48. void    thread_block(void);
  49. void    thread_set_timeout(int ticks);
  50. void    thread_sleep(int event, simple_lock_t lock, boolean_t interruptible);
  51.  
  52. /* Get information about this thread or task: */
  53.  
  54. #ifdef    MACH_USER_API
  55. extern task_t     current_task_EXTERNAL();
  56. extern thread_t    current_thread_EXTERNAL();
  57. #define current_task()     current_task_EXTERNAL()
  58. #define current_thread() current_thread_EXTERNAL()
  59. #endif    MACH_USER_API
  60.  
  61. task_t    (current_task)(void);
  62. int    thread_wait_result(void);
  63. extern  task_t task_self();
  64. extern     thread_t thread_self();
  65.  
  66. /* Create or kill a thread: */
  67. thread_t    kernel_thread(task_t task, void (*start)());
  68. void        thread_halt_self(void);
  69. #endif    KERNEL
  70.  
  71. /* Get or test a virtual address that corresponds to a hardware address: */
  72. caddr_t    map_addr(caddr_t address, int size);
  73. int    probe_rb(void *address);
  74.  
  75. /* Kill the loadable kernel server: */
  76. #if    defined(KERNEL) && !defined(KERNEL_BUILD) && !defined(ASSERT)
  77. #if    DEBUG
  78. #define    ASSERT(e) \
  79.     if ((e) == 0) { \
  80.         printf ("ASSERTION " #e " failed at line %d in %s\n", \
  81.             __LINE__, __FILE__); \
  82.         panic ("assertion failed"); \
  83.     }
  84. #else    DEBUG
  85. #define ASSERT(e)
  86. #endif    DEBUG
  87. #endif    defined(KERNEL) && defined(KERNEL_BUILD) && !defined(ASSERT)
  88.  
  89. /* Modify or inspect a string: */
  90. char *    strcat(char *string1, const char *string2);
  91. int     strcmp(const char *string1, const char *string2);
  92. int     strncmp(const char *string1, const char *string2, unsigned long len);
  93. char *    strcpy(char *to, const char *from);
  94. char *  strncpy(char *to, const char *from, unsigned long len);
  95. size_t     strlen(const char *string);
  96.  
  97. /* In a UNIX-style server, determine whether the user has root privileges: */
  98. int    suser(void);
  99.  
  100. #endif    _KERN_INTERNAL_PROTOTYPES_
  101.